/**
 * 
 */
package com.ihg.hiex.entity.session.during;

import org.apache.commons.lang3.StringUtils;

import com.demo2do.core.utils.Alias;

/**
 * @author downpour
 *
 */
@Alias("SessionAnchorScoreType")
public enum SessionAnchorScoreType {
    
    DN("Development Need", "DN", "dn", 1, "anchor.score.dn"),
    
    S("Strength", "S", "s", 5, "anchor.score.s"),
    
    C("Competent", "C", "c", 3, "anchor.score.c"),
    
    WARN("warn", "!", "", 0, ""),
    
    DN_C("DN-C", "DN-C", "", 2, "anchor.score.dn-c"),
    
    C_S("C-S", "C-S", "", 4, "anchor.score.c-s"),
    
    NA("N/A", "NA", "", 0, "");

    private String description;
    
    private String alias;
    
    private String name;
    
    private int score;
    
    private String message;

    /**
     * @param description
     * @param alias
     * @param score
     * @param message
     */
    private SessionAnchorScoreType(String description, String alias, String name, int score, String message) {
        this.description = description;
        this.alias = alias;
        this.name = name;
        this.score = score;
        this.message = message;
    }

    /**
     * 
     * @param alias
     * @return
     */
    public static SessionAnchorScoreType aliasOf(String alias) {
        for(SessionAnchorScoreType anchorScoreType : SessionAnchorScoreType.values()) {
            if(StringUtils.equalsIgnoreCase(anchorScoreType.getAlias(), alias)) {
                return anchorScoreType;
            }
        }
        return null;
    }
    
    /**
     * 
     * @return
     */
    public boolean isDn() {
        return this.equals(DN);
    }
    
    /**
     * 
     * @return
     */
    public boolean isDn_C() {
        return this.equals(DN_C);
    }
    
    /**
     * 
     * @return
     */
    public boolean isC() {
        return this.equals(C);
    }
    
    /**
     * 
     * @return
     */
    public boolean isC_S(){
        return this.equals(C_S);
    }
    
    /**
     * 
     * @return
     */
    public boolean isS() {
        return this.equals(S);
    }
    
    /**
     * 
     * @return
     */
    public boolean isNa() {
        return this.equals(NA);
    }
    
    /**
     * 
     * @return
     */
    public boolean isCompetencyScore() {
        return !this.isWarn() && !this.isNa() && !this.isDn_C() && !this.isC_S();
    }
    
    public String getLowAlias() {
        return this.alias.toLowerCase();
    }
    
    /**
     * 
     * @return
     */
    public boolean isWarn() {
        return this.equals(WARN);
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @return the alias
     */
    public String getAlias() {
        return alias;
    }
    
    /**
     * 
     * @return
     */
    public String getName() {
        return name;
    }

    /**
     * @return the score
     */
    public int getScore() {
        return score;
    }
    
    /**
     * @return
     */
    public String getMessage() {
        return message;
    }
    
}
